﻿@model WebUI.Models.MessageNewViewModel
<h2 class="section">Contact @Model.Receiver.Ind.FullName <span class="meta">About Work</span></h2>
<div class="smallspacer"></div>
<div class="contact-head">
    <strong>From:</strong>
    <span class="contact-email">@Model.Sender.UserName&nbsp;&lt;@Model.Sender.Email&gt;</span>
</div>
<div class="contact-head">
    <strong>To:</strong>
    <a href="/user/@Model.Receiver.Login.UserName" class="url" rel="contact" target="_blank" title="@Model.Receiver.Ind.FullName">@Model.Receiver.Ind.FullName</a>
</div>

@using (Html.BeginForm("new", "message", new {ReceiptID = Model.ReceiptID}, FormMethod.Post, new { ID = "NewMessageForm"}))
{
    <div class="contact-head contact-cc">
        <strong>Cc:</strong>
        @Html.CheckBoxFor(m => m.CopyMessage)&nbsp;Send me a copy of this message
    </div>
    <div class="contact-form">
        <div class="smallspacer"></div>
        <div><strong>Your message:</strong></div>
        @Html.TextAreaFor(m => m.Message, new { @class = "message" })
    </div>
    <div class="minispacer"></div>
    <p>
        <strong>Work or project inquiries only, please.</strong> Spammers will be suspended.
    </p>
    <button type="button" class="gray-submit cancel">Cancel</button>
    <input class="blue-submit" id="message_submit" name="commit" type="submit" value="Send" />
}

<script type="text/javascript">
    $("#NewMessageForm").ajaxForm({
        beforeSubmit: function (a, f, o) {
        },
        dataType: 'json',
        success: ProcessNewMessage,
        error: function (request, status, errorThrown) {     
            return false;
        }
    });
</script>